-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regex String Functions #1516
Regex String Functions #1516
Conversation
fbc9bec
to
d4f9833
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start!
- Our CI uses the clang-format tool to check the formatting of our code. You can get a copy of the format checking script here: https://github.com/Sarcasm/run-clang-format/blob/master/run-clang-format.py. Be sure to check the formatting of your code using this tool before pushing.
- Please make sure that your code can pass all the CI before submitting.
- We prefer to squash all commits into one for each PR.
If you have any questions related to my comments, feel free to message me.
13ace76
to
9e3b399
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1516 +/- ##
==========================================
+ Coverage 91.91% 91.93% +0.02%
==========================================
Files 678 685 +7
Lines 24458 24640 +182
==========================================
+ Hits 22480 22653 +173
- Misses 1978 1987 +9
☔ View full report in Codecov by Sentry. |
src/include/function/string/operations/regexp_extract_all_operation.h
Outdated
Show resolved
Hide resolved
9e3b399
to
395fb82
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a base RegexOperation class and let other regexOperations inherit it.
We can put common methods: parseCypherPattern
and copyToKuzuString
under this class.
src/include/function/string/operations/regexp_extract_all_operation.h
Outdated
Show resolved
Hide resolved
src/include/function/string/operations/regexp_extract_all_operation.h
Outdated
Show resolved
Hide resolved
src/include/function/string/operations/regexp_extract_all_operation.h
Outdated
Show resolved
Hide resolved
src/include/function/string/operations/regexp_extract_all_operation.h
Outdated
Show resolved
Hide resolved
src/include/function/string/operations/regexp_extract_operation.h
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a base RegexOperation class and let other regexOperations inherit it.
We can put common methods: parseCypherPattern
and copyToKuzuString
under this class.
Rename RE_MATCH function to REGEXP_FULL_MATCH The latter is more descriptive and complaint with duckdb's naming convention. Introduce regexp utils based on re2 Refactor regex_full_match implementation Functions added: 1.regexp_matches(string, regex) Returns true if a part of string matches the regex. 2. regexp_replace(string, regex, replacement) Replaces the first occurrence of regex with the replacement, 3. regexp_extract(string, regex[, group = 0]) Split the string along the regex and extract first occurrence of group. 4. regexp_extract_all(string, regex[, group = 0]) Split the string along the regex and extract all occurrences of group.
395fb82
to
a682d24
Compare
Functions added:
regexp_matches(string, regex)
Returns true if a part of string matches the regex.
regexp_replace(string, regex, replacement)
Replaces the first occurrence of regex with the replacement,
regexp_extract(string, regex[, group = 0])
Split the string along the regex and extract first occurrence of group.
regexp_extract_all(string, regex[, group = 0])
Split the string along the regex and extract all occurrences of group.
I have read and agree to the terms under CLA.md